<template>
    <div class="app-container">
        <card-container
            ref="card685"
            :list="list"
            :list-loading="listLoading"
            @loadMore="loadMore" />
    </div>
</template>

<script>
import cardContainer from '@/components/card/fm-card-container'
// import cardInterface from '@/mixins/cardInterface'
import { cardformInitData2 } from '@/api/api'
export default {
    name: 'emp_hetongdqi_vue',
    components: { cardContainer },
    data() {
        return {
            formId: '6513',
            list: [],
            listLoading: true,
            totalData: -1,
            sortParams: {},
            requestParam: {

            },
            filterData: {

            },
            jsonList: { 'list': [{ 'type': 'grid', 'name': '栅格布局', 'icon': 'icon-grid-', 'columns': [{ 'span': 24, 'list': [{ 'type': 'icon', 'name': '图标', 'icon': 'icon-input', 'options': { 'iconName': 'icon-shiyongqiyuangong', 'color': '#000', 'fontSize': '40px', 'remoteFunc': 'func_1560163033000_6892' }, 'key': '1560163033000_6892', 'model': 'icon_1560163033000_6892', 'rules': [] }, { 'type': 'title', 'name': '合同到期人数', 'icon': 'icon-input', 'options': { 'defaultValue': '##P|EMPVCONTRACT_CONTNUM##', 'inline': false, 'textAlign': 'center', 'color': '#000', 'fontSize': '12px', 'fontWeight': 600, 'marginLeft': '0px', 'marginRight': '0px', 'titleHeight': '50', 'lineHeight': '20', 'linkType': 'inline', 'linkUrl': '/form/WORK_DESK/control_WARNING/WARNING_CONTRACTOVER', 'query': '', 'remoteFunc': 'func_1560163067000_1756' }, 'key': '1560163067000_1756', 'model': 'title_1560163067000_1756', 'rules': [] }] }], 'options': { 'gutter': 0, 'justify': 'start', 'align': 'top', 'remoteFunc': 'func_1559456617000_87240' }, 'key': '1559456617000_87240', 'model': 'grid_1559456617000_87240', 'rules': [] }], 'config': { 'formId': '6513', 'labelWidth': 100, 'labelPosition': 'top', 'size': 'small', 'column': 1, 'xl': 24, 'lg': 24, 'md': 24, 'sm': 24, 'height': '' }}}
    },
    async created() {
        this._cardformInitData()
    },
    methods: {
        loadMore() {
            this._cardformInitData('loadMore')
        },
        _cardformInitData() {
            const params = {
                'containerParam': {},
                'paramsMap': {},
                'requestParam': this.requestParam,
                'filter': this.filterData,
                'formId': this.formId,
                'isView': null,
                'limit': 20,
                'offset': 0,
                'order': 'asc',
                'templateJson': JSON.stringify(this.jsonList)
            }
            cardformInitData2(params)
                .then((response) => {
                    console.log(response)
                    if (response) {
                        this.listLoading = false
                        console.log(JSON.parse(response.data))
                        const list = JSON.parse(response.data)
                        this.list = list
                    }
                })
                .catch(function(error) {
                    console.log(error)
                })
        }
    }
}
</script>

